import request from '@/router/axios';
export const Categories = (query) => { // 商品类型列表
  return request({
    url: '/api/xmbz-goods/goods/getCategories',
    // url: 'http://192.168.2.106:8105/goods/getCategories',
    method: 'get',
    params: query
  })
}

export const CakeWhereaboutsList = (query) => { //商品原料列表
  return request({
    // url: 'http://192.168.2.106:8105/goods/getCakeWhereaboutsList',
    url: '/api/xmbz-goods/goods/getCakeWhereaboutsList',
    method: 'get',
    params: query
  })
}
export const GoodsMaterial = (query) => { //商品原料列表
  return request({
    // url: 'http://192.168.2.106:8105/goods/getGoodsMaterial',
    url: '/api/xmbz-goods/goods/getGoodsMaterial',
    method: 'get',
    params: query
  })
}
export const addGoods = (data) => { //添加商品
  return request({
    // url: 'http://192.168.2.11:8105/goods/addGoods',
    url: '/api/xmbz-goods/goods/addGoods',
    method: 'post',
    data
  })
}
export const goodsList = (query) => { //商品列表
  return request({
    // url: 'http://192.168.2.106:8105/goods/getQueryGoodsPage',
    // url: '/api/xmbz-goods/goods/getQueryGoodsPage',
    url:'/api/xmbz-goods/goods/getQueryGoodsArchivesPage',
    method: 'get',
    params: query
  })
}

export const getQueryMaintainGoodsPage = (query) => { //待维护商品列表
  return request({
    // url: 'http://192.168.2.106:8105/goods/getQueryGoodsPage',
    // url: '/api/xmbz-goods/goods/getQueryGoodsPage',
    url:'/api/xmbz-goods/goods/getQueryMaintainGoodsPage',
    method: 'get',
    params: query
  })
}
export const deleteGoods = (query) => { //商品删除
  return request({
    // url: 'http://192.168.2.106:8105/goods/deleteGoods',
    url: '/api/xmbz-goods/goods/deleteGoods',
    method: 'get',
    params: query
  })
}
export const GoodsInfo = (query) => { //商品详情
  return request({
    // url: 'http://192.168.2.11:8105/goods/getGoodsInfo',
    url: '/api/xmbz-goods/goods/getGoodsInfo',
    method: 'get',
    params: query
  })
}
export const goodsUpdate = (data) => { //商品更新
  return request({
    // url: 'http://192.168.2.11:8105/goods/updateGoods',
    url: '/api/xmbz-goods/goods/updateGoods',
    method: 'post',
    data
  })
}


export const getChannelList = (query) => { //获取渠道列表接口
  return request({
    // url: 'http://192.168.2.106:8105/goods/getGoodsInfo',
    url: '/api/xmbz-order/order/getChannelList',
    method: 'get',
    params: query
  })
}

export const queryDeptChannel = (query) => { //新增城市渠道分页查询
  return request({
    url: '/api/xmbz-system/deptChannel/queryDeptChannel',
    method: 'get',
    params: query
  })
}

export const getBydeptId = (query) => { // 根据城市ID查询记录
  return request({
    url: '/api/xmbz-system/deptChannel/getBydeptId',
    method: 'get',
    params: query
  })
}


export const saveOrUpdate = (data) => { // 新增/修改城市渠道记录
  return request({
    url: '/api/xmbz-system/deptChannel/saveOrUpdate',
    method: 'post',
    data
  })
}


export const deleteChannel = (query) => { // 删除城市渠道记录
  return request({
    url: '/api/xmbz-system/deptChannel/delete',
    method: 'POST',
    params: query
  })
}

// 团购下单
export const getLinkType = (query) => { // 获取所有的团购链接类型
  return request({
    url: '/api/xmbz-order/orderGroupLink/getLinkType',
    method: 'get',
    params: query
  })
}
export const getqueryPage = (query) => { // 获取通用链接
  return request({
    url: '/api/xmbz-order/orderGroupLink/queryPage',
    method: 'get',
    params: query
  })
}
export const getCurrencyLink = (query) => { // 获取通用链接
  return request({
    url: '/api/xmbz-order/orderGroupLink/getSpecialLink',
    method: 'get',
    params: query
  })
}
export const deleteById = (query) => { // 删除列表
  return request({
    url: '/api/xmbz-order/orderGroupLink/deleteById',
    method: 'post',
    params: query
  })
}

export const getNameAndSpecsByName = (query) => { // 获取蛋糕组成
  return request({
    url: '/api/xmbz-goods/goods/getNameAndSpecsByName',
    method: 'get',
    params: query
  })
}

export const LinksaveOrUpdate = (data) => { // 新增/修改团购链接
  return request({
    url: '/api/xmbz-order/orderGroupLink/saveOrUpdate',
    method: 'post',
    data
  })
}

export const getgroupDetails = (query) => { // 根据ID获取团购链接记录
  return request({
    url: '/api/xmbz-order/orderGroupLink/getById',
    method: 'get',
    params: query
  })
}

//
export const searchGoodsList = (query) => { // 蛋糕搜索
  return request({
    url: '/api/xmbz-goods/goods/searchGoodsList',
    // url: 'http://192.168.2.106:8105/goods/searchGoodsList',
    method: 'get',
    params: query
  })
}

// 渠道类别列表
export const getOrderChannelTypeList = (query) => {
  return request({
    url: '/api/xmbz-order/order/getOrderChannelTypeList',
    // url: 'http://192.168.2.11:8107/order/getOrderChannelTypeList',
    method: 'get',
    params: query
  })
}

// 渠道列表接口
export const getOrderChannelListProtFile= (query) => {
  return request({
    url: '/api/xmbz-system/deptChannel/getQueryOrderChannelPage',
    // url: 'http://192.168.2.11:8107/order/getOrderChannelList',
    method: 'get',
    params: query
  })
}
export const addOrderChannel = (data) => { // 新增订单渠道
  return request({
    url: '/api/xmbz-system/deptChannel/v2/addOrderChannel',
      // url: 'http://192.168.2.11:8108/deptChannel/addOrderChannel',
    method: 'post',
    data
  })
}
export const setWxNumber = (data) => { // 设置微信公众号
  return request({
    url: '/api/xmbz-order/orderGroupLink/open/setWxNumber',
    method: 'post',
    data
  })
}
// 获取微信公众号
export const getWxNumber = (query) => {
  return request({
    url: '/api/xmbz-order/orderGroupLink/getKeyWxNumber',
    // url: 'http://192.168.2.11:8107/order/getOrderChannelList',
    method: 'get',
    params: query
  })
}

export const citySelect = (query) => {
  return request({
    // url: 'http://dev.crm.xiongmaodangao.com/dept/depts',
    url: '/api/xmbz-system/dept/depts',
    method: 'get',
    params: query
  })
}

// 编辑渠道城市
export const editChannelCity = (data) => {
  return request({
    url: '/api/xmbz-system/deptChannel/editCity',
    method: 'post',
    data: data
  })
}

// 输入提示
export const getAssistant = (query) => {
  return request({
    url: '/api/xmbz-order/orderGroupLink/open/getAssistant',
    method: 'get',
    params: query
  })
}

// 商品档案导出
export const downLoadGoodsExcel = (query) => {
  return request({
    url: '/api/xmbz-goods/goods/downLoadGoodsExcel',
    method: 'get',
    params: query,
    responseType: 'blob',
  })
}

// 商品批量修改
export const uploadSkuExcel = (data) => {
  return request({
    url: '/api/xmbz-goods/file/uploadSkuExcel',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'multipart/form-data'},
  })
}

// 批量新增团购单品
export const batchGroupSave = (data) => {
  return request({
    url: '/api/xmbz-order/orderGroupLink/batchSave',
    method: 'post',
    data
  })
}

// 批量更新团购单品
export const batchGroupUpdate = (data) => {
  return request({
    url: '/api/xmbz-order/orderGroupLink/batchUpdate',
    method: 'post',
    data
  })
}

// 批量删除团购单品
export const batchGroupDelete = (data) => {
  return request({
    url: '/api/xmbz-order/orderGroupLink/batchDelete',
    method: 'post',
    data
  })
}